<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
?><form method="post" action="/server/query_server.php" id="serverform" name="serverform">

<table border="0" cellpadding="5" cellspacing="1" width="1000">
<tr valign="top">
<td>

<table border="0" cellpadding="5" cellspacing="1" width="500" class="formtable">
<tr valign="top">
	<td class="formfielddesc">Server:<br />
		<span class="required">{required}</span></td>
	<td class="formfield">
		<input type="text" value="<?=$serverInfo["hostname"];?>" name="hostname" class="textfield" />
	</td>
</tr>
<tr valign="top">
	<td class="formfielddesc">Operating System Type:<br />
		</td>
	<td class="formfield">
		<select name="os_type" size="1">
		<?
		foreach ($aOSType as $nKey => $sVal)
		{
			if ($nKey == $serverInfo["os_type"])
			{
				$s = "selected";
			}
			else
			{
				$s = "";
			}
			?>
			<option value="<?=$nKey;?>" <?=$s;?>><?=$sVal;?></option>
			<?
		}
		?>
		</select>
	</td>
</tr>
<tr valign="top">
	<td class="formfielddesc">Monitoring INI:<br />
		<span class="required">{required}</span></td>
	<td class="formfield">
		<select name="iniID" size="1" class="selectfield">
	<?
	
	$aIniFiles = $BigDaddyData->GetIniFiles();
	
	if (is_array($aIniFiles))
	{
		foreach ($aIniFiles as $nIndex => $row)
		{
			if ($serverInfo["iniID"]==$row["ID"])
			{
				$s=" selected";
			}
			else
			{
				$s="";
			}
			?>
			<option value="<?=$row["ID"];?>"<?=$s;?>><?=$row["name"];?></option>
			<?
		}
	}
	?>
	</select>
	</td>
</tr>
<tr valign="top">
	<td class="formfielddesc">Monitor Reports<br />
		</td>
	<td class="formfield">
		<select name="mon_externalreport" size="1" class="selectfield">
			<option value="0"<? if ($serverInfo["mon_externalreport"]==0) echo " selected";?>>No</option>
			<option value="1"<? if ($serverInfo["mon_externalreport"]==1) echo " selected";?>>Yes</option>
		</select>
	</td>
</tr>
<tr>
	<td class="formfielddesc">Start Level</td>
	<td class="formfield">
	<select name="mon_startlevel" size="1" class="selectfield">
	<?
	for ($i=1; $i<6; $i++)
	{
		if ($i==$serverInfo["mon_startlevel"])
		{
			$s=" selected";
		}
		else
		{
			$s="";
		}
	?>
	<option value="<?=$i;?>"<?=$s;?>><?=$i;?></option>
	<?
	}
	?>
	</select>
	
	</td>
	</tr>
	<tr>
	<td class="formfielddesc">End Level</td>
	<td class="formfield">
	<select name="mon_endlevel" size="1" class="selectfield">
	<option value="0">All Levels</option>
	<?
	for ($i=1; $i<6; $i++)
	{
		if ($i==$serverInfo["mon_endlevel"])
		{
			$s=" selected";
		}
		else
		{
			$s="";
		}
	?>
	<option value="<?=$i;?>"<?=$s;?>><?=$i;?></option>
	<?
	}
	?>
	</select>
	
	</td>
	</tr>

</table>

</td>
<td>

	<table border="0" cellpadding="5" cellspacing="1" width="500" class="formtable">
	<tr valign="top">
	<td class="formfielddesc"><b>Categories</b></td>
	</tr>
	<td class="formfield">
	
	<?
	
	if ($type=="edit")
	{
		$aServerCategories = $BigDaddyData->GetServerCategoriesByServerID($_REQUEST["serverID"]);

		if (is_array($aServerCategories))
		{
			foreach ($aServerCategories as $nIndex => $row)
			{
				$serverMapArray[$row["categoryID"]]=1;
			}
		}
	}
	
	$aServerCategories = $BigDaddyData->GetServerCategories();
	
	if (is_array($aServerCategories))
	{
		foreach ($aServerCategories as $nIndex => $row)
		{
			if ($serverMapArray[$row["ID"]]==1)
			{
				$c=" checked";
			}
			else
			{
				$c="";
			}
			?>
			<input type="checkbox" name="cat[]" value="<?=$row["ID"];?>" <?=$c;?> /> <?=$row["name"];?><br />
			<?
		}
	}
	?>
	
	
	</td>
	</tr>
	</table>
	
	

</td>
</tr>

<tr valign="top">
	
	<td class="formfielddesc" colspan="2">
	Notes:
	</td>
</tr>

<tr valign="top">
	
	<td class="formfield" colspan="2">
	<style>
	
	.textareafield
	{
		width: 800;
		height: 200;
	}
	</style>
	
		<textarea name="notes" class="textareafield" wrap="virtual"><?=$serverInfo["notes"];?></textarea>
	
	</td>
</tr>



<tr valign="top">
	<td class="formfielddesc" colspan="2">
	<div align="center"><?
	if ($type=="addnew")
	{
	?>
		<input type="hidden" name="action" value="addserver" />
		<!-- <input type="submit" value="Add New Server" name="submit" class="submitbutton" /> -->
	<?
	}
	
	if ($type=="edit")
	{
	?>
		<input type="hidden" name="action" value="editserver" />
		<input type="hidden" name="serverID" value="<?=$_REQUEST["serverID"];?>" />
		<!-- <input type="submit" value="Edit Server" name="submit" class="submitbutton" /> -->
	<?
	}
	?></div>
	
	</td>
</tr>
</table>

<br />



</form>
